#include <cstdio>
#include <vector>

/**
 * Luogu P1057: Ball Passing Game
 */

int main() {
    // Compute distribution of S = \sum_{i=1}^m a_i (a_i \in {-1, 1})
    int n, m;
    scanf("%d %d", &n, &m);
    std::vector<int> distrib(2 * m + 1, 0);
    distrib[0 + m] = 1;
    for (int p = 0; p < m; p++) {
        std::vector<int> newDistrib(2 * m + 1, 0);
        for (int i = 0; i <= 2 * m; i++) {
            if (i > 0)
                newDistrib[i] += distrib[i - 1];
            if (i < 2 * m)
                newDistrib[i] += distrib[i + 1];
        }
        distrib = newDistrib;
    }

    // Count number of S where S is multiple of n
    int count = 0;
    for (int i = -m; i <= m; i++)
        if (i % n == 0)
            count += distrib[i + m];
    printf("%d\n", count);

    return 0;
}